# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-libretranslatepy
_pkgname=libretranslatepy
pkgver=2.1.4
pkgrel=3
pkgdesc='Python bindings for LibreTranslate API'
arch=('any')
url='https://pypi.org/project/libretranslatepy/#files'
license=('MIT')
depends=('python')
makedepends=('python-build' 'python-pip' 'python-wheel')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('5fecf78a57e76a29779656ad789e094548e6dd76415f1f980ac43fae8c7c5fbcae041914a9fa26d61ebf9f0384f8a0064d32494d04401030e18d674e78d38395')

build() {
  cd "$_pkgname-$pkgver"

  python -m build --wheel --outdir="$startdir/dist"
}

package() {
  cd "$_pkgname-$pkgver"

  pip install \
    --verbose \
    --disable-pip-version-check \
    --no-warn-script-location \
    --ignore-installed \
    --no-compile \
    --no-deps \
    --root="$pkgdir" \
    --prefix=/usr \
    --no-index \
    --find-links="file://$startdir/dist" \
    $_pkgname
}

